package cn.yxm.recsys.online.service.impl;

import cn.yxm.recsys.online.dao.MovieDao;
import cn.yxm.recsys.online.dto.MovieDto;
import cn.yxm.recsys.online.entity.Movie;
import cn.yxm.recsys.online.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MovieServiceImpl implements MovieService {

    @Autowired
    MovieDao movieDao;

    @Override
    public Movie getMovie(Integer id) {
        return movieDao.getMovie(id);
    }

    @Override
    public List<MovieDto> getList(List<Integer> ids) {
        return movieDao.getList(ids);
    }

    @Override
    public List<MovieDto> getMoviesByGenre(Integer genreId, Integer topK) {
        return movieDao.getMoviesByGenre(genreId, topK);
    }

    @Override
    public List<MovieDto> getMoviesByUser(Integer userId, Integer topK) {
        return movieDao.getMoviesByUser(userId, topK);
    }
}
